<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>用户注册页面</title>
</head>

<style>

    .introduce {
        width: 400px;
        height:200px;
    }

    #intro {
        vertical-align: top;
    }

</style>

<body>
    <form onsubmit="return verify()" method="POST">

        <p>用户：<input id="userName" name="userName" type="text" placeholder="请输入账号..."/></p>
        <p>密码：<input name="password" type="password"/></p>
        <p>性别：
            <input name="sex" type="radio" value="1" checked="checked"/>男
            <input name="sex" type="radio" value="2"/>女
        </p>
        <p>学历：
            <input name="education" type="radio" value="1" checked="checked"/>本科
            <input name="education" type="radio" value="2"/>专科
        </p>
        <p><span id="intro">自我介绍：</span><textarea id="introduce" name="introduce" class="introduce"></textarea></p>
        <button>提交</button>
    </form>

    <script>
        function verify(){
            var userName = document.getElementById("userName").value;
            var intro = document.getElementById("introduce").value;
            if(! ("admin" == userName)) {
                alert("只能是admin用户！");
                return false;
            }else {
                alert(intro);
                return true;
            }
        }
    </script>
</body>
</html>